package com.bestcem.xm.survey.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bestcem.xm.component.mybatis.base.ResultPage;
import com.bestcem.xm.component.mybatis.service.IXmService;
import com.bestcem.xm.survey.controller.vo.SurveyQuotaCheckItemVo;
import com.bestcem.xm.survey.controller.vo.SurveyQuotaConditionVo;
import com.bestcem.xm.survey.entity.SurveyQuotaCondition;

import java.util.List;

/**
 * @author guita
 * @description 针对表【ds_survey_quotacondition】的数据库操作Service
 * @createDate 2023-01-09 15:15:37
 */
public interface SurveyQuotaConditionService extends IXmService<SurveyQuotaCondition> {

    JSONObject getCheckpointsWithQuotas(String project_id);

    SurveyQuotaConditionVo getById(String id);

    List<SurveyQuotaConditionVo> getAll(String projectId, String quotaId);

    List<SurveyQuotaConditionVo> getByIds(List<String> ids);

    ResultPage<JSONObject> getByPage(Page<SurveyQuotaCondition> page, String projectId, String quotaId);

    JSONObject getNormalQuotaUsedOptions(String projectId);

    JSONObject createQuota(String projectId, String quotaId, Object param);

    JSONObject updateQuota(String projectId, String quotaId, String id, JSONObject param);

    JSONObject updateNormalQuota(String projectId, String quotaId, JSONObject param);

    JSONObject updateQuotaItem(String projectId, String quotaId, String quotaCondId, String id, JSONObject param);

    JSONObject deleteQuota(String projectId, String quotaId, String oid, JSONObject param);

    List<JSONObject> genNormalQuotaDataCommon(String quotaId);

    JSONObject genCrossQuotaDataCommon(String quotaId);

    JSONObject getQuotaCross(String projectId, String quotaId);

    JSONObject updateQuotaCrossItem(String projectId, String quotaId, String id, JSONObject param);

    void refreshQuotaProgress(String quotaId);

    void genQuotaNumDelay(String projectId, String quotaId, Long seq);

    List<String> createCrossQuotaCondition(String projectId, String quotaId, JSONObject param);

    List<SurveyQuotaCheckItemVo> getAllMatchQuotaCheckitemV2(String projectId, String pageAnswers, String quotaId);

    void deleteQuotas(List<String> QuotaIds);

    void copyQuota(List<String> conditionList, String oldId, String newId);

    void createImportQuota(List<String> conditionList, String targetProjectId, String newQuotaId, JSONObject data);

    JSONObject getQuotaStruct(String projectId);
}
